<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Navo Portable Library: CRC-16</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Navo Portable Library&#160;<span id="projectnumber">Ver 1.0.20120827</span></div>
   <div id="projectbrief">Provides generic platform independent facilities.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>数据结构</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">数据结构</a> &#124;
<a href="#define-members">宏定义</a> &#124;
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<h1>CRC-16</h1>  </div>
<div class="ingroups"><a class="el" href="group___xE7_xAD_xBE_xE5_x90_x8D_xE5_x93_x88_xE5_xB8_x8C.html">签名哈希</a></div></div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
数据结构</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcrc16__ctx.html">crc16_ctx</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">CRC-16上下文  <a href="structcrc16__ctx.html#_details">更多...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
宏定义</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga06d5a7c67c0157f1dde2e7eab5c6d971"></a><!-- doxytag: member="CRC&#45;16::CRC16_SIZE" ref="ga06d5a7c67c0157f1dde2e7eab5c6d971" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#ga06d5a7c67c0157f1dde2e7eab5c6d971">CRC16_SIZE</a>&#160;&#160;&#160;2</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">16位CRC码表长度 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga829e841ea440f01b8a69809655ad7f19"></a><!-- doxytag: member="CRC&#45;16::CRC16_POS_CCITT" ref="ga829e841ea440f01b8a69809655ad7f19" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CRC16_POS_CCITT</b>&#160;&#160;&#160;__cpu_to_le16_c(INT16_C(0x1021))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3a2878ff85234833d06c83fc4f3222e2"></a><!-- doxytag: member="CRC&#45;16::CRC16_NEG_CCITT" ref="ga3a2878ff85234833d06c83fc4f3222e2" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CRC16_NEG_CCITT</b>&#160;&#160;&#160;__cpu_to_le16_c(INT16_C(0x8428))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga57732706fc51fef8913e86cd17324e9c"></a><!-- doxytag: member="CRC&#45;16::CRC16_POS_IBM" ref="ga57732706fc51fef8913e86cd17324e9c" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CRC16_POS_IBM</b>&#160;&#160;&#160;__cpu_to_le16_c(INT16_C(0x8005))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7a03251c0680f3b61a105d12fa4e35dc"></a><!-- doxytag: member="CRC&#45;16::CRC16_NEG_IBM" ref="ga7a03251c0680f3b61a105d12fa4e35dc" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CRC16_NEG_IBM</b>&#160;&#160;&#160;__cpu_to_le16_c(INT16_C(0xA001))</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae9ae7520869ca0e186864b79df892a1e"></a><!-- doxytag: member="CRC&#45;16::CRC16_CTX" ref="gae9ae7520869ca0e186864b79df892a1e" args="(name)" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#gae9ae7520869ca0e186864b79df892a1e">CRC16_CTX</a>(name)&#160;&#160;&#160;<a class="el" href="structcrc16__ctx.html">crc16_ctx</a> name = {CRC16_POS_CCITT, 0}</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">定义名为name的CRC16上下文 <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga03442a343af8c3b6db633dd8ca28d539"></a><!-- doxytag: member="CRC&#45;16::CRC16_TBL_SIZE" ref="ga03442a343af8c3b6db633dd8ca28d539" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CRC16_TBL_SIZE</b>&#160;&#160;&#160;0x100</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#ga41179c48ee7b4189f3a08154a0d7cc9f">crc16_process</a>(ctx, buf, cnt)&#160;&#160;&#160;__crc16_process(ctx, (<a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a>*)(buf), cnt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">用位移的方式计算CRC  <a href="#ga41179c48ee7b4189f3a08154a0d7cc9f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#ga5d819f24e29b1fc043c62cb21fa7cfd9">crc16_update</a>(ctx, tbl, buf, cnt)&#160;&#160;&#160;__crc16_update(ctx, tbl, (<a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a>*)(buf), cnt)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">用查表的方式计算CRC  <a href="#ga5d819f24e29b1fc043c62cb21fa7cfd9"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
函数</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#ga5ad218af978eb0211e524ee4258d965a">crc16_build</a> (uint16_t *buf, uint16_t poly)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">建立CRC码表  <a href="#ga5ad218af978eb0211e524ee4258d965a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#ga7df4f16a949dba787cb86c40c0a2d1bf">crc16_init</a> (<a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *ctx, uint16_t poly)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化CRC上下文  <a href="#ga7df4f16a949dba787cb86c40c0a2d1bf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga311d3d9bc424feb89a332b2467131c34"></a><!-- doxytag: member="CRC&#45;16::__crc16_process" ref="ga311d3d9bc424feb89a332b2467131c34" args="(crc16_ctx *ctx, uint8_t *buf, size_t cnt)" -->
NV_API void&#160;</td><td class="memItemRight" valign="bottom"><b>__crc16_process</b> (<a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *ctx, <a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a> *buf, size_t cnt)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gacdd04604237a020e73aec0e92537d58f"></a><!-- doxytag: member="CRC&#45;16::__crc16_update" ref="gacdd04604237a020e73aec0e92537d58f" args="(crc16_ctx *ctx, const uint16_t *tbl, uint8_t *buf, size_t cnt)" -->
NV_API void&#160;</td><td class="memItemRight" valign="bottom"><b>__crc16_update</b> (<a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *ctx, const uint16_t *tbl, <a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a> *buf, size_t cnt)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2285e95f110035b37d36dab1ff0fb490"></a><!-- doxytag: member="CRC&#45;16::__crc16_final" ref="ga2285e95f110035b37d36dab1ff0fb490" args="(crc16_ctx *ctx, uint16_t crc)" -->
static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>__crc16_final</b> (<a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *ctx, uint16_t crc)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#ga56f5d6f198c3308487648a3219b317c3">crc16_final</a> (<a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *ctx)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">获取CRC校验值  <a href="#ga56f5d6f198c3308487648a3219b317c3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">NV_API uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CRC-16.html#gacbb1836c68b56bc083aea965b65cda6a">crc16_hash_nbstr</a> (const char *str, uint16_t *tbl)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">直接哈希字符串  <a href="#gacbb1836c68b56bc083aea965b65cda6a"></a><br/></td></tr>
</table>
<hr/><h2>宏定义文档</h2>
<a class="anchor" id="ga41179c48ee7b4189f3a08154a0d7cc9f"></a><!-- doxytag: member="crc16.h::crc16_process" ref="ga41179c48ee7b4189f3a08154a0d7cc9f" args="(ctx, buf, cnt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define crc16_process</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ctx, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">cnt&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;__crc16_process(ctx, (<a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a>*)(buf), cnt)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>用位移的方式计算CRC </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>上下文 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>输入缓存 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cnt</td><td>缓存大小(按字节) </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>用法同 crc16_update </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group__CRC-16.html#ga7df4f16a949dba787cb86c40c0a2d1bf" title="初始化CRC上下文">crc16_init</a>, <a class="el" href="group__CRC-16.html#ga5d819f24e29b1fc043c62cb21fa7cfd9" title="用查表的方式计算CRC">crc16_update</a>, <a class="el" href="group__CRC-16.html#ga56f5d6f198c3308487648a3219b317c3" title="获取CRC校验值">crc16_final</a> </dd></dl>

<p>在文件<a class="el" href="crc16_8h_source.html">crc16.h</a>第<a class="el" href="crc16_8h_source.html#l00125">125</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga5d819f24e29b1fc043c62cb21fa7cfd9"></a><!-- doxytag: member="crc16.h::crc16_update" ref="ga5d819f24e29b1fc043c62cb21fa7cfd9" args="(ctx, tbl, buf, cnt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define crc16_update</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">ctx, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">tbl, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">buf, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">cnt&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;__crc16_update(ctx, tbl, (<a class="el" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2">uint8_t</a>*)(buf), cnt)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>用查表的方式计算CRC </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>上下文 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tbl</td><td>CRC码表 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>输入缓存 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cnt</td><td>缓存大小(按字节) </td></tr>
  </table>
  </dd>
</dl>
<dl class="note"><dt><b>注解:</b></dt><dd>用法同 crc16_process </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group__CRC-16.html#ga7df4f16a949dba787cb86c40c0a2d1bf" title="初始化CRC上下文">crc16_init</a>, <a class="el" href="group__CRC-16.html#ga41179c48ee7b4189f3a08154a0d7cc9f" title="用位移的方式计算CRC">crc16_process</a>, <a class="el" href="group__CRC-16.html#ga56f5d6f198c3308487648a3219b317c3" title="获取CRC校验值">crc16_final</a> </dd></dl>

<p>在文件<a class="el" href="crc16_8h_source.html">crc16.h</a>第<a class="el" href="crc16_8h_source.html#l00141">141</a>行定义。</p>

</div>
</div>
<hr/><h2>函数文档</h2>
<a class="anchor" id="ga5ad218af978eb0211e524ee4258d965a"></a><!-- doxytag: member="crc16.h::crc16_build" ref="ga5ad218af978eb0211e524ee4258d965a" args="(uint16_t *buf, uint16_t poly)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API void crc16_build </td>
          <td>(</td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>poly</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>建立CRC码表 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">buf</td><td>码表缓存 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">poly</td><td>多项式，必须是小端字节序的16位整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="user"><dt><b>示例:</b></dt><dd><div class="fragment"><pre class="fragment">    <a class="code" href="structcrc16__ctx.html" title="CRC-16上下文">crc16_ctx</a> crc;

    <span class="comment">// 分配码表缓存</span>
    uint16_t* crc_tbl = (uint16_t*)malloc(<span class="keyword">sizeof</span>(uint16_t) * CRC16_TBL_SIZE);
    <span class="keywordflow">if</span> (!crc_tbl)
        <span class="keywordflow">return</span> 0;

    <span class="comment">// 建立码表</span>
    <a class="code" href="group__CRC-16.html#ga5ad218af978eb0211e524ee4258d965a" title="建立CRC码表">crc16_build</a>(crc_tbl, CRC16_POS_IBM);

    <span class="comment">// 初始化上下文</span>
    <a class="code" href="group__CRC-16.html#ga7df4f16a949dba787cb86c40c0a2d1bf" title="初始化CRC上下文">crc16_init</a>(&amp;crc, 0);

    <span class="keywordflow">while</span> (buf_size &gt;= BLOCK_SIZE) {
        <span class="comment">// 计算校验码</span>
        <a class="code" href="group__CRC-16.html#ga5d819f24e29b1fc043c62cb21fa7cfd9" title="用查表的方式计算CRC">crc16_update</a>(&amp;crc, crc_tbl, buf, BLOCK_SIZE);
        buf += BLOCK_SIZE;
        buf_size -= BLOCK_SIZE
    }
    <span class="keywordflow">if</span> (buf_size) {
        <span class="comment">// 计算校验码</span>
        <a class="code" href="group__CRC-16.html#ga5d819f24e29b1fc043c62cb21fa7cfd9" title="用查表的方式计算CRC">crc16_update</a>(&amp;crc, crc_tbl, buf, buf_size);
    }

    <span class="comment">// 返回结果</span>
    <span class="keywordflow">return</span> <a class="code" href="group__CRC-16.html#ga56f5d6f198c3308487648a3219b317c3" title="获取CRC校验值">crc16_final</a>(&amp;crc);
</pre></div> </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group__CRC-16.html#ga7df4f16a949dba787cb86c40c0a2d1bf" title="初始化CRC上下文">crc16_init</a> </dd></dl>

<p>在文件<a class="el" href="crc16_8c_source.html">crc16.c</a>第<a class="el" href="crc16_8c_source.html#l00021">21</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga7df4f16a949dba787cb86c40c0a2d1bf"></a><!-- doxytag: member="crc16.h::crc16_init" ref="ga7df4f16a949dba787cb86c40c0a2d1bf" args="(crc16_ctx *ctx, uint16_t poly)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline void crc16_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>poly</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>初始化CRC上下文 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">ctx</td><td>上下文 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">poly</td><td>多项式，必须是小端字节序的16位整数，若为0，表示使用原poly值 </td></tr>
  </table>
  </dd>
</dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group__CRC-16.html#ga5ad218af978eb0211e524ee4258d965a" title="建立CRC码表">crc16_build</a> </dd></dl>

<p>在文件<a class="el" href="crc16_8h_source.html">crc16.h</a>第<a class="el" href="crc16_8h_source.html#l00107">107</a>行定义。</p>

</div>
</div>
<a class="anchor" id="ga56f5d6f198c3308487648a3219b317c3"></a><!-- doxytag: member="crc16.h::crc16_final" ref="ga56f5d6f198c3308487648a3219b317c3" args="(crc16_ctx *ctx)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static inline uint16_t crc16_final </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcrc16__ctx.html">crc16_ctx</a> *&#160;</td>
          <td class="paramname"><em>ctx</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>获取CRC校验值 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>上下文 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>uint16_t 返回小端字节序的校验值 </dd></dl>
<dl class="see"><dt><b>参见:</b></dt><dd><a class="el" href="group__CRC-16.html#ga7df4f16a949dba787cb86c40c0a2d1bf" title="初始化CRC上下文">crc16_init</a>, <a class="el" href="group__CRC-16.html#ga41179c48ee7b4189f3a08154a0d7cc9f" title="用位移的方式计算CRC">crc16_process</a>, <a class="el" href="group__CRC-16.html#ga5d819f24e29b1fc043c62cb21fa7cfd9" title="用查表的方式计算CRC">crc16_update</a> </dd></dl>

<p>在文件<a class="el" href="crc16_8h_source.html">crc16.h</a>第<a class="el" href="crc16_8h_source.html#l00157">157</a>行定义。</p>

</div>
</div>
<a class="anchor" id="gacbb1836c68b56bc083aea965b65cda6a"></a><!-- doxytag: member="crc16.h::crc16_hash_nbstr" ref="gacbb1836c68b56bc083aea965b65cda6a" args="(const char *str, uint16_t *tbl)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">NV_API uint16_t crc16_hash_nbstr </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>tbl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>直接哈希字符串 </p>
<dl><dt><b>参数:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>多字节字符串 </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tbl</td><td>码表 </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>返回:</b></dt><dd>uint16_t 返回小端字节序的哈希值 </dd></dl>

<p>在文件<a class="el" href="crc16_8c_source.html">crc16.c</a>第<a class="el" href="crc16_8c_source.html#l00070">70</a>行定义。</p>

</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>数据结构</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2015年七月16日 星期四 12:00:41 for Navo Portable Library by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
